package com.netflexitysolutions.amazonws.ec2.internal.operations;

import com.amazonaws.ec2.doc._2009_04_04.ConfirmProductInstanceType;
import com.netflexitysolutions.amazonws.ec2.EC2;

public class ConfirmProductInstanceOperation extends OperationExecutor<ConfirmProductInstanceType, String> {

	private String productCode;
	
	private String instanceId;
	
	public ConfirmProductInstanceOperation(EC2 ec2, String productCode, String instanceId) {
		super(ec2);
		this.productCode = productCode;
		this.instanceId = instanceId;
	}

	@Override
	protected String call(ConfirmProductInstanceType request) {
		request.setInstanceId(instanceId);
		request.setProductCode(productCode);
		return getEC2().getService().confirmProductInstance(request).getOwnerId();
	}

}
